<?php
/**
 * 轻云网络验证系统
 * =======================================================
 * 版权所有(C) 2019-2039 daenx.cn，并保留所有权利。
 * 作者：Daen大恩
 * 作者QQ: 1330166565
 * 开发群：661059773
 * =======================================================
 */
    include 'farmwork.php';
	header("content-type:text/html;charset=utf-8");
	login();
	$sql = "SELECT * FROM duijie where lx='yzf'"; 
	$result=mysqli_query($con,$sql);
	if($result&&mysqli_num_rows($result)){
	   while ($row=mysqli_fetch_assoc($result)) {
			$yzf_kg = $row['kg'];
			$yzf_id = $row['shid'];
			$yzf_key = $row['shkey'];
	   }
	}

	$action = $_GET['action'];
	if($action=='do'){
		$yzf_kg = $_POST['yzf_kg'];
		$yzf_id = $_POST['yzf_id'];
		$yzf_key = $_POST['yzf_key'];
		$sql = "UPDATE `duijie` SET `shid` = '$yzf_id', `shkey` = '$yzf_key', `kg` = '$yzf_kg' where lx='yzf'";
	    mysqli_query($con,$sql);
		mysqli_close();
		echo("<script language=\"javascript\" type=\"text/javascript\" src=\"/data/assets/js/jquery.min.js\"></script><script language=\"javascript\" type=\"text/javascript\" src=\"/data/assets/layer/layer.js\"></script><script>layer.open({  type: 1  ,title: false   ,closeBtn: false  ,area: '200px;'  ,shade: 0.8  ,id: 'LAY_layuipro'   ,resize: false  ,btn: ['确定']  ,moveType: 1   ,content: '<div style=\"padding: 30px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;\">更新成功！</div>'  ,success: function(layero){ var btn = layero.find('.layui-layer-btn');  btn.find('.layui-layer-btn0').attr({ href: 'setup-dj.php' });  }});</script>");
	}

$li6='class="active"';
$li64='class="active"';
?>
<?php include 'header.php';?>
    <title>支付设置-<?php echo $title?></title>
<?php include 'list.php';?>
    <!--main content start-->
    <section id="main-content">
        <section class="wrapper">
<?php include 'overview.php';?>
            <div class="row">
                <div class="col-md-12">
                    <!--work progress start-->
                    <section class="panel">
                        <header class="panel-heading">
                        易支付
                        </header>
                        <div class="panel-body">
	
           <form class="form-horizontal tasi-form" action="setup-dj.php?action=do" method="post" role="form">
  
                               		<div class="form-group">
									<label class="col-sm-2 col-sm-2 control-label">是否启用易支付</label>
										<div class="col-sm-10">
											<select name="yzf_kg" class="form-control">
											<?php if($yzf_kg == 1)
												{echo '<option value="0">否</option>
												<option value="1" selected>是</option>';}
												else 
												{echo '<option value="0" selected>否</option>
												<option value="1">是</option>';}
											?>
											</select>
										</div>
									</div> 

                                    <div class="form-group">
                                        <label class="col-sm-2 col-sm-2 control-label">商户ID</label>
                                        <div class="col-sm-10">
                                             <input type="text" name="yzf_id" class="form-control" value='<?php echo $yzf_id?>'>
                                        </div>
                                    </div>

									
                                  <div class="form-group">
                                        <label class="col-sm-2 col-sm-2 control-label">商户秘钥</label>
                                        <div class="col-sm-10">
                                            <input type="text" name="yzf_key" class="form-control" value='<?php echo $yzf_key?>'>
											<span class="help-block">请去http://pay.hackwl.cn/申请</span>
                                        </div>
                                   </div>

                                
			<div id="bottom" class="form-group">
			<label class="col-sm-2 col-sm-2 control-label"></label>
			  <button class="btn btn-info btn-lg" type="submit" value="true" id="submit"/><i class="fa fa-refresh" id="spinner"></i> <span id="btnText">更新设置</span></button>
            </div>
                            </form>
                        </div>
                    </section>
                    <!--work progress end-->
                </div>

        </section>
    </section>
    <!--main content end-->

<?php include 'footer.php';?>